<template>
  <el-container style="height: 100vh;">
    <el-aside width="220px">
      <el-menu router :default-openeds="['']" unique-opened :default-active="$router.path">
        <el-submenu index="1">
          <template #title><i class="el-icon-message"></i>内容管理</template>
          <el-menu-item-group>
            <template #title class="category tab">分类</template>
            <el-menu-item index="/categories/create">新建分类</el-menu-item> 
            <el-menu-item index="/categories/list">分类列表</el-menu-item>
          </el-menu-item-group>
          <el-menu-item-group>
            <template #title class="item tab">装备</template>
            <el-menu-item index="/items/create">新建装备</el-menu-item>
            <el-menu-item index="/items/list">装备列表</el-menu-item> 
          </el-menu-item-group>
          <el-menu-item-group>
            <template #title class="hero tab">英雄</template>
            <el-menu-item index="/heros/create">新建英雄</el-menu-item>
            <el-menu-item index="/heros/list">英雄列表</el-menu-item> 
          </el-menu-item-group>
          <el-menu-item-group>
            <template #title class="article tab">文章</template>
            <el-menu-item index="/articles/create">新建文章</el-menu-item>
            <el-menu-item index="/articles/list">文章列表</el-menu-item> 
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="2">
          <template #title><i class="el-icon-message"></i>运营管理</template>
          <el-menu-item-group>
            <template #title class="ads tab">广告位</template>
            <el-menu-item index="/ads/create">新建广告位</el-menu-item>
            <el-menu-item index="/ads/list">广告位列表</el-menu-item> 
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="3">
          <template #title><i class="el-icon-message"></i>系统设置</template>
          <el-menu-item-group>
            <template #title class="admin-user tab">管理员</template>
            <el-menu-item index="/admin-user/create">新建管理员</el-menu-item>
            <el-menu-item index="/admin-user/list">管理员列表</el-menu-item> 
          </el-menu-item-group>
        </el-submenu>
      </el-menu>
    </el-aside>

    <el-container>
      <el-header style="text-align: right; font-size: 12px">
        <el-dropdown>
          <i class="el-icon-setting" style="margin-right: 15px"></i>
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item>View</el-dropdown-item>
              <el-dropdown-item>Add</el-dropdown-item>
              <el-dropdown-item>Delete</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
        <span>wuwei</span>
      </el-header>

      <!-- 主页面 -->
      <el-main>
        <router-view  :key="$route.path"/>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>

export default ({
  name: 'Home',
  data() {
    return {
      date: '2016-05-02',
      name: 'Tom',
      address: 'No. 189, Grove St, Los Angeles',
    }
  }
})
</script>

<style>
  .el-header {
    background-color: #405064;
    line-height: 60px;
  }
  .el-menu-item-group {
    background-color: #405064;
  }
  .el-menu-item {
    color: #409eff;
  }

</style>
